<template>
  <div class="login-index" :style="'background: #f5f5f5;'">
    <Login :show="isShow" :show-close="false" @callback="callback" @success="success"/>
  </div>
</template>
<script>
import { ref } from "vue";
import Login from "./Login";
import router from "../../router";

export default {
  name: "LoginIndex",
  components: {
    Login
  },
  setup() {
    // 显示登录框
    const isShow = ref(true);
    // 登录回调
    const callback = () => {
      isShow.value = true;
    };
    //登录成功回调
    const success = () => {
      router.push({ path: "/index" });
    };
    return {
      isShow,
      callback,
      success
    };
  }
};
</script>

<style scoped lang="scss">
.login-index {
  position: fixed;
  height: 100%;
  width: 100%;
  background-size: cover;
}
.hidden {
  display: none;
}
</style>
